<script setup>
    import { watch , defineProps } from 'vue';

    // eslint-disable-next-line no-unused-vars
    const props = defineProps({
        current : Number,
        total : Number, 
    });


    watch(() => props.current, () => props.total);
    
    function getProcessPercent() {
        return Math.floor((props.current / props.total) * 100);
    }


</script>

<template>
    <div clss="process-bar-wapper">
        
        <div class="process-text">
            {{ props.current }} / {{ props.total }}
        </div>
        <div class="process-bar">
            <div class="process-bar-inner" :style="{ width: getProcessPercent() + '%' }"></div>
        </div>
    </div>
</template>

<style scoped>
.process-bar-wapper {
    font-family: 'Arial', sans-serif;
    width: 100%;
    padding: 1rem;
    min-width: 18.75rem;
    box-sizing: border-box;
}

.process-text {
    color: #32CD32;
    text-shadow: 0 0 8px rgba(50, 205, 50, 0.5);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

.process-bar {
    height: 1.5rem;
    background: #1A1A1A;
    border: 2px solid #32CD32;
    border-radius: 0.5rem;
    box-shadow: 
        0 0 12px #32CD32,
        inset 0 0 20px rgba(50, 205, 50, 0.1);
    position: relative;
    overflow: hidden;
    min-width: 18.75rem;
    flex-shrink: 0;
}

.process-bar-inner {
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(50, 205, 50, 0.8) 0%,
        rgba(173, 255, 47, 0.9) 50%,
        rgba(50, 205, 50, 0.8) 100%
    );
    transition: width 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

/* 流光扫描效果 */
.process-bar-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: scan 2s infinite linear;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 150%; }
}

/* 能量核心脉冲效果 */
.process-bar:hover .process-bar-inner {
    filter: brightness(1.1);
    box-shadow: 
        inset 0 0 15px #ADFF2F,
        0 0 20px rgba(50, 205, 50, 0.5);
}
</style>